package com.drk.skifree;



import org.anddev.andengine.entity.sprite.AnimatedSprite;
import org.anddev.andengine.entity.sprite.Sprite;
import org.anddev.andengine.opengl.texture.region.TextureRegion;

public class ObjectSprite extends Sprite {


	private static final int CAMERA_WIDTH = 720;
	private static final int CAMERA_HEIGHT = 480;
	public Boolean delme;
	public Boolean Collide = true;
	public Boolean bJumpable = false;
	public Boolean bSlow = false;
	
	public ObjectSprite(int pX, int pY, TextureRegion pTextureRegion) {
		super(pX, pY, pTextureRegion);
		delme = false;
		
	}
	
@Override
public void reset()
{
	delme = false;
// init code will be ran in here for loc etc	
}

public void Update(AnimatedSprite i)
{
	if(this.getY() < i.getY() - CAMERA_HEIGHT) {
		//this.setPosition((new Random().nextInt(CAMERA_WIDTH)), CAMERA_HEIGHT + new Random().nextInt(750));
		//Log.v("Coin","Y < 0 Recyclying sprite");
		delme = true;
		//Tree_POOL.recyclePoolItem(spr);
		//spr.detachSelf();
		//currentobjects--;
		return;

	}
	/*switch(i)
	{
	case 0:
		this.setPosition(this.getX(), this.getY() - 4);
		break;
	case 1:
		this.setPosition(this.getX() - 2, this.getY() - 2);
		break;
	case 2:
		this.setPosition(this.getX() + 2, this.getY() - 2);
		break;
	case 3:
		this.setPosition(this.getX() - 1, this.getY() - 3);
		break;
	case 4:
		this.setPosition(this.getX() + 1, this.getY() - 3);
		break;
		default:
			break;
	}*/
}

	public ObjectSprite(TextureRegion mTextureRegion) {
		super(0,0,mTextureRegion);
		delme = false;
	}

	public ObjectSprite(TextureRegion textureRegion, int textid) {
		super(0,0,textureRegion);
		switch(textid)
		{
		case 4:
			bJumpable = true;
			break;
		case 5:
			bJumpable = true;
			break;
		case 6:
			bJumpable = true;
			break;
		case 7:
			bJumpable = true;
			bSlow = true;
			break;
		case 8:
			bJumpable = true;
			break;
			
		}
		delme = false;
	}



}
